//
//  WDXXViewController.m
//  Hxcsfw
//
//  Created by qiysoft on 2017/11/15.
//  Copyright © 2017年 企友软mac. All rights reserved.
//

#import "WDXXViewController.h"
#import "WDXXCell.h"
#define WDXXCellIndentifier @"WDXXCellIndentifier"
#import "VideoDetailViewController.h"

@interface WDXXViewController ()<UITableViewDelegate,UITableViewDataSource>
{
    WDXXCell *cell1;
}
@end

@implementation WDXXViewController

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    self.navigationController.navigationBarHidden = YES;

}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.navigationItem.title = @"我的消息";
    self.navigationController.navigationBarHidden = NO;

    // 1.注册控件
    UINib *cellNib = [UINib nibWithNibName:@"WDXXCell" bundle:nil];
    [self.myTableView registerNib:cellNib forCellReuseIdentifier:WDXXCellIndentifier];
    _myTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    self.prototypeCell  = [self.myTableView dequeueReusableCellWithIdentifier:WDXXCellIndentifier];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

//设置UITableViewCell的数据
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    cell1  = [[[NSBundle mainBundle] loadNibNamed:@"WDXXCell" owner:self options:nil] lastObject];
    
    return cell1;
    
}

//行点击事件
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
    [tableView deselectRowAtIndexPath:indexPath animated:NO];
    
    VideoDetailViewController *vdVC = [[VideoDetailViewController alloc]init];
    vdVC.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:vdVC animated:YES];
}

//分组个数
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

//列表行数
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 10;
    
}

//设置行高度
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    return 230;
    
}

@end
